import java.util.Scanner;

public class CarTest {
    public static void main(String[] args) {
        //1.创建数组
        Car[]arr=new Car[3];
        //
        Scanner scanner=new Scanner(System.in);
        for (int i = 0; i <arr.length ; i++) {
            //创建汽车对象
            Car c=new Car();
            System.out.println("请输入汽车品牌");
            String brand=scanner.next();
            c.setBrand(brand);
            //价格
            System.out.println("请输入价格");
            int price=scanner.nextInt();
            c.setPrice(price);
            arr[i]=c;
        }
        for (int i = 0; i < arr.length; i++) {
            Car car = arr[i];
            System.out.println(car.getBrand());

        }
    }
}
